APM.BusinessDetailExperienceBrowserController = Ember.Controller.extend({
	needs: ["businessCenter", "businessDetail"],

	business: Ember.computed.alias('controllers.businessDetail.model'),

	clickTimePoint: Ember.computed.oneWay('controllers.businessDetail.clickTimePoint'),

	timePointLisenterEvent:Ember.computed("clickTimePoint", function(key, value){
		var view = Broada.getView("businessTimeRangesTopo");
			if(this.get("clickTimePoint") != null){
			var date = new Date(this.get("clickTimePoint"));
			if(typeof view != "undefined"){
				var range = view.getTimeRange().endDate - view.getTimeRange().startDate;				
				this.set("startDate", new Date(date-range));
				this.set("endDate", date);
			}
			typeof view != "undefined"?view.set("btnTxt", date?APM.util.formatDate(date, "f"):null):null;
			this.set("dayTime",APM.util.formatDate(date, "yyyy-MM-dd"));
			this.requirePerformances();
		}
	}),

	startDate: null,

	endDate: null,

	dayTime:APM.util.formatDate(new Date(new Date() - timeD_value),"yyyy-MM-dd"),

	panelTitle: Ember.computed(function(){
		if(overviewOrCenterSwitch == "business"){
			return "交易量";
		}else{
			return "吞吐量";
		}
	}),

	init: function(){
		this.set("cancelSet",true);
	},

	requirePerformances: function(time){
		var ctrl = this;
		var business = this.get("business");

		var startDate = this.get("startDate"),
			endDate = this.get("endDate");

		var todySDate = new Date(APM.util.formatDate(startDate,"yyyy-MM-dd"));
		var todyEDate = new Date(APM.util.formatDate(endDate,"yyyy-MM-dd"));
			startDate = new Date(todySDate.setHours(0));
			todyEDate.setHours(23);
			todyEDate.setMinutes(59);
			todyEDate.setSeconds(59);
			endDate = new Date(todyEDate);

		var baseParams = {
			appId: business.id,
			orderBy: 'system/user/unique',
			top: 3,
			startDate: +startDate,
			endDate: +endDate,
			panelId: overviewOrCenterSwitch
		};

		//开发调试模式参数
		if( isLocalDebugModel ){
			baseParams = {};
		}

		//浏览器
		this.store.ajax("GET", "performances/dimensionType",
			Ember.merge({dimensionType: 'browser'}, baseParams))
		.then(function(response){
			ctrl.set("browserPerformances", Ember.A(response["performances"]));
		});
		//设备
		this.store.ajax("GET", "performances/dimensionType",
			Ember.merge({dimensionType: 'device'}, baseParams))
		.then(function(response){
			ctrl.set("devicePerformances", Ember.A(response["performances"]));
		});
		//os
		this.store.ajax("GET", "performances/dimensionType",
			Ember.merge({dimensionType: 'os'}, baseParams))
		.then(function(response){
			ctrl.set("osPerformances", Ember.A(response["performances"]));
		});
	},

	actions: {
		timeRangesChange: function(timeRange){
			this.set("startDate", timeRange.startDate);
			this.set("endDate", timeRange.endDate);
			this.requirePerformances();
		}
	}
});

	